﻿using System;

namespace SharpSqlAnalyzer.nodes
{
	// Token: 0x0200032C RID: 812
	public class TParameterDeclaration : TParseTreeNode
	{
		// Token: 0x06001D12 RID: 7442 RVA: 0x0033296C File Offset: 0x00330B6C
		public void setDefaultValue(TExpression e)
		{
			this.defaultValue = e;
		}

		// Token: 0x06001D13 RID: 7443 RVA: 0x00332975 File Offset: 0x00330B75
		public void setMode(int m)
		{
			this.mode = m;
		}

		// Token: 0x170006BD RID: 1725
		// (get) Token: 0x06001D14 RID: 7444 RVA: 0x0033297E File Offset: 0x00330B7E
		// (set) Token: 0x06001D15 RID: 7445 RVA: 0x00332986 File Offset: 0x00330B86
		public virtual EParameterMode ParameterMode
		{
			get
			{
				return this.parameterMode;
			}
			set
			{
				this.parameterMode = value;
			}
		}

		// Token: 0x170006BE RID: 1726
		// (get) Token: 0x06001D17 RID: 7447 RVA: 0x00332998 File Offset: 0x00330B98
		// (set) Token: 0x06001D16 RID: 7446 RVA: 0x0033298F File Offset: 0x00330B8F
		public virtual bool Nocopy
		{
			get
			{
				return this.nocopy;
			}
			set
			{
				this.nocopy = value;
			}
		}

		// Token: 0x170006BF RID: 1727
		// (get) Token: 0x06001D18 RID: 7448 RVA: 0x003329A0 File Offset: 0x00330BA0
		// (set) Token: 0x06001D19 RID: 7449 RVA: 0x003329A8 File Offset: 0x00330BA8
		public virtual TTypeName DataType
		{
			get
			{
				return this.dataType;
			}
			set
			{
				this.dataType = value;
			}
		}

		// Token: 0x170006C0 RID: 1728
		// (get) Token: 0x06001D1B RID: 7451 RVA: 0x00332A1F File Offset: 0x00330C1F
		// (set) Token: 0x06001D1A RID: 7450 RVA: 0x003329B4 File Offset: 0x00330BB4
		public virtual int Mode
		{
			get
			{
				return this.mode;
			}
			set
			{
				this.mode = value;
				switch (this.mode)
				{
				case 1:
					this.parameterMode = EParameterMode.@in;
					return;
				case 2:
					this.parameterMode = EParameterMode.@out;
					return;
				case 3:
					this.parameterMode = EParameterMode.inout;
					return;
				case 4:
					this.parameterMode = EParameterMode.output;
					return;
				case 5:
					this.parameterMode = EParameterMode.@readonly;
					return;
				case 6:
					this.parameterMode = EParameterMode.aslocator;
					return;
				default:
					return;
				}
			}
		}

		// Token: 0x170006C1 RID: 1729
		// (get) Token: 0x06001D1C RID: 7452 RVA: 0x00332A27 File Offset: 0x00330C27
		// (set) Token: 0x06001D1D RID: 7453 RVA: 0x00332A2F File Offset: 0x00330C2F
		public virtual TExpression DefaultValue
		{
			get
			{
				return this.defaultValue;
			}
			set
			{
				this.defaultValue = value;
			}
		}

		// Token: 0x170006C2 RID: 1730
		// (get) Token: 0x06001D1E RID: 7454 RVA: 0x00332A38 File Offset: 0x00330C38
		// (set) Token: 0x06001D1F RID: 7455 RVA: 0x00332A40 File Offset: 0x00330C40
		public virtual TObjectName ParameterName
		{
			get
			{
				return this.parameterName;
			}
			set
			{
				this.parameterName = value;
			}
		}

		// Token: 0x170006C3 RID: 1731
		// (get) Token: 0x06001D21 RID: 7457 RVA: 0x00332A52 File Offset: 0x00330C52
		// (set) Token: 0x06001D20 RID: 7456 RVA: 0x00332A49 File Offset: 0x00330C49
		public virtual bool? NotNull
		{
			get
			{
				return this.NotNull_Renamed;
			}
			set
			{
				this.NotNull_Renamed = value;
			}
		}

		// Token: 0x170006C4 RID: 1732
		// (get) Token: 0x06001D22 RID: 7458 RVA: 0x00332A5A File Offset: 0x00330C5A
		// (set) Token: 0x06001D23 RID: 7459 RVA: 0x00332A62 File Offset: 0x00330C62
		public virtual int HowtoSetValue
		{
			get
			{
				return this.howtoSetValue;
			}
			set
			{
				this.howtoSetValue = value;
			}
		}

		// Token: 0x170006C5 RID: 1733
		// (get) Token: 0x06001D24 RID: 7460 RVA: 0x00332A6B File Offset: 0x00330C6B
		// (set) Token: 0x06001D25 RID: 7461 RVA: 0x00332A73 File Offset: 0x00330C73
		public virtual bool Varying
		{
			get
			{
				return this.isVarying;
			}
			set
			{
				this.isVarying = value;
			}
		}

		// Token: 0x170006C6 RID: 1734
		// (get) Token: 0x06001D26 RID: 7462 RVA: 0x00332A7C File Offset: 0x00330C7C
		// (set) Token: 0x06001D27 RID: 7463 RVA: 0x00332A84 File Offset: 0x00330C84
		public virtual TConstant VaryPrecision
		{
			get
			{
				return this.varyPrecision;
			}
			set
			{
				this.varyPrecision = value;
			}
		}

		// Token: 0x06001D28 RID: 7464 RVA: 0x00332A8D File Offset: 0x00330C8D
		public override void init(object arg1, object arg2)
		{
			if (arg1 != null)
			{
				this.parameterName = (TObjectName)arg1;
				this.parameterName.ObjectType = 9;
			}
			this.dataType = (TTypeName)arg2;
		}

		// Token: 0x06001D29 RID: 7465 RVA: 0x00332AB8 File Offset: 0x00330CB8
		public override void init(object arg1, object arg2, object arg3)
		{
			this.init(arg1, arg2);
			if (arg3 != null)
			{
				if (arg3 is TParameterMode)
				{
					this.parameterMode = ((TParameterMode)arg3).ParameterMode;
					return;
				}
				TDummy tdummy = (TDummy)arg3;
				if (tdummy.dbvendor == EDbVendor.dbvoracle || tdummy.dbvendor == EDbVendor.dbvdb2)
				{
					if (tdummy.int1 == 1)
					{
						this.defaultValue = (TExpression)tdummy.node1;
						this.howtoSetValue = tdummy.int1;
						return;
					}
					if (tdummy.int1 == 2)
					{
						this.defaultValue = (TExpression)tdummy.node1;
						this.howtoSetValue = tdummy.int1;
						return;
					}
				}
				else if (tdummy.dbvendor == EDbVendor.dbvmssql || tdummy.dbvendor == EDbVendor.dbvsybase)
				{
					if (tdummy.st2 != null)
					{
						this.isVarying = true;
						if (tdummy.node2 != null)
						{
							this.varyPrecision = (TConstant)((TDummy)tdummy.node2).node1;
						}
					}
					this.howtoSetValue = tdummy.int1;
					if (tdummy.node1 != null)
					{
						this.defaultValue = (TExpression)tdummy.node1;
					}
					if (tdummy.st1 != null)
					{
						if (tdummy.st1.ToString().Equals("out", StringComparison.CurrentCultureIgnoreCase))
						{
							this.mode = 2;
							this.parameterMode = EParameterMode.@out;
						}
						else if (tdummy.st1.ToString().Equals("in", StringComparison.CurrentCultureIgnoreCase))
						{
							this.mode = 1;
							this.parameterMode = EParameterMode.@in;
						}
						else if (tdummy.st1.ToString().Equals("output", StringComparison.CurrentCultureIgnoreCase))
						{
							this.mode = 4;
							this.parameterMode = EParameterMode.output;
						}
						else if (tdummy.st1.ToString().Equals("inout", StringComparison.CurrentCultureIgnoreCase))
						{
							this.mode = 3;
							this.parameterMode = EParameterMode.inout;
						}
						if (tdummy.st1.ToString().Equals("readonly", StringComparison.CurrentCultureIgnoreCase))
						{
							this.mode = 5;
							this.parameterMode = EParameterMode.@readonly;
						}
					}
				}
			}
		}

		// Token: 0x06001D2A RID: 7466 RVA: 0x00332C95 File Offset: 0x00330E95
		public override void accept(TParseTreeVisitor v)
		{
			v.preVisit(this);
			v.postVisit(this);
		}

		// Token: 0x06001D2B RID: 7467 RVA: 0x00332CA5 File Offset: 0x00330EA5
		public override void acceptChildren(TParseTreeVisitor v)
		{
			v.preVisit(this);
			v.postVisit(this);
		}

		// Token: 0x04001A94 RID: 6804
		private int mode;

		// Token: 0x04001A95 RID: 6805
		private bool nocopy;

		// Token: 0x04001A96 RID: 6806
		private EParameterMode parameterMode;

		// Token: 0x04001A97 RID: 6807
		private TObjectName parameterName;

		// Token: 0x04001A98 RID: 6808
		private TTypeName dataType;

		// Token: 0x04001A99 RID: 6809
		private TExpression defaultValue;

		// Token: 0x04001A9A RID: 6810
		private int howtoSetValue;

		// Token: 0x04001A9B RID: 6811
		private bool? NotNull_Renamed = new bool?(false);

		// Token: 0x04001A9C RID: 6812
		private bool isVarying;

		// Token: 0x04001A9D RID: 6813
		private TConstant varyPrecision;
	}
}
